package com.zhuang.factory.absfactory;

/**
 * @Classname AbstractFactoryProcucerTest
 * @Description 抽象类的工厂类测试类
 * @Date 2021/3/18 16:15
 * @Created by dell
 */

public class AbstractFactoryProducerTest {
    public static void main(String[] args) {
        AbstractFactory shapeFactory = AbstractFactoryProducer.createFactory("Shape");
        assert shapeFactory != null;
        Shape rectangle = shapeFactory.createShape("Rectangle");
        Shape circle = shapeFactory.createShape("Circle");
        Shape square = shapeFactory.createShape("Square");
        rectangle.draw();
        circle.draw();
        square.draw();
        System.out.println("====================================");
        AbstractFactory colorFactory = AbstractFactoryProducer.createFactory("Color");
        Color red = colorFactory.createColor("Red");
        Color yellow = colorFactory.createColor("Yellow");
        Color black = colorFactory.createColor("Black");
        red.fill();
        yellow.fill();
        black.fill();

    }
}
